<%@ Page Language="vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script  runat="server">
Sub Page_Load(sender As Object, e As EventArgs)	
Try
	Dim strConn As String
	strConn=ConfigurationSettings.appSettings("conn")
	Dim myConn As SqlConnection  = _
	New SqlConnection(strConn)
	Dim myXmlQuery As String
	myXmlQuery="Select * from tblSubCategories "
	myXmlQuery +=" FOR XML AUTO, XMLDATA "
	myConn.Open	
	Dim myCommand As SqlCommand = _
	New SqlCommand(myXmlQuery, myConn)
      	Dim myXmlReader As System.Xml.XmlReader = _
	myCommand.ExecuteXmlReader()
     	myXmlReader.Close()
Catch objError As Exception
	outError.innerHTML = "<b>* Error</b>: " & _
	objError.Message & "<p />"		
End Try
End Sub
</script>	
<html>
<head>
<title>ADO.NET </title>
</head>
<body >   
       
<div id="outError" runat="server" />
<br />
</body>
</html>

